<?php 
// 过滤邮箱
$mail = 'houdunwangmzy@163.com';
$mail = 'houdunwangmzy@126.com';
$mail = '210004417@qq.com';
$mail = 'houdunwangmzy@sina.com.cn';
$mail = 'houdunwang_mzy@sina.com.cn';
$mail = 'houdunwang-mzy@sina.com.cn';
// $preg='/^([a-zA-Z0-9]+[_|/_|/.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|/_|/.]?)*[a-zA-Z0-9]+/.[a-zA-Z]{2,3}$/is';
$preg="/^[a-z,{123456789}]([a-z0-9]*[-_]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?$/is"; 
	$bloon=preg_match($preg, $mail);
	echo $bloon.'<br />';
	// 过滤网址
// $httpStr = 'https://www.baidu.com';
// $httpStr = 'http://www.baidu.com';
// $httpStr = 'http://baidu.com';
// $httpStr = 'ftp://www.baidu.com';
// $httpStr = 'www.baidu.com';
// $httpStr = 'baidu.com';
// $httpStr = 'www.baidu.com.cn';
// $httpStr = 'www.baidu.net';
$httpStr = '_1baidu.net';

	$preg1="/^(http|https|ftp|[A-Z0-9])+[:\/\/]*([A-Z0-9](?:.[A-Z0-9][A-Z0-9_-]*)+)+(\d+)?\/?[A-Z0-9\_\-]*$/i";
	$bloon1=preg_match($preg1, $httpStr);
	echo $bloon1;
	$str = <<<str
<li id="menu-item-4438" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-4438"><a href="http://www.daqianduan.com/topic/front/htmlcss">HTML/CSS</a></li>
	<li id="menu-item-4439" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-4439"><a href="http://www.daqianduan.com/topic/front/javascript">JavaScript</a></li>
	<li id="menu-item-4437" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-4437"><a href="http://www.daqianduan.com/topic/resource">技巧资源</a></li>
</ul>
</li>
<li id="menu-item-5154" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-5154"><a href="http://www.daqianduan.com/topic/design">设计</a></li>
<li id="menu-item-5012" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-5012"><a href="http://www.daqianduan.com/topic/job">招聘</a></li>
<li id="menu-item-5220" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-5220"><a href="http://www.daqianduan.com/theme">WordPress主题</a>
<ul class="sub-menu">
str;
	$str1=htmlspecialchars(addslashes($str)); 
	$preg2='/\.daqianduan\./is';
	$bl=preg_match($preg2, $str);
	echo $bl;
	$rpic=preg_replace($preg2, '.houdunwang.', $str);
	// echo "<pre>";
	var_dump($rpic);


 ?>